<template>
  <div>
    <mymenue-2></mymenue-2>
    {{$route.params.userid}}

    <el-table :data="tableData" border style="width: 100%">
      <el-table-column fixed prop="id" label="id" width="150"></el-table-column>
      <el-table-column prop="username" label="姓名" width="120"></el-table-column>
      <el-table-column prop="password" label="密码" width="120"> </el-table-column>
      <el-table-column prop="status" label="状态" width="120"> </el-table-column>
      
    </el-table>
    <!-- 自己添加的 -->
    <pageinfo></pageinfo>
  </div>
</template>

<script>
import Mymenue2 from './mymenue2.vue';
import pageinfo from './pageinfo.vue';
export default {
  components: { pageinfo, Mymenue2 },
  methods: {
    handleClick(row) {
      console.log(row);
    },
    findAllUser(){
      this.$axios.get("/userManager/user").then((res)=>{
        console.log(res);
        if(res.data.code ==200){
          this.tableData = res.data.data
        }
      }).catch(()=>{})
    }
  },
  data() {
    return {
      tableData: [
        {
          id:'001',
          username: "王小虎",
          password: '1234',
          status: 1,
        },
      ],
    };
  },
  // 钩子函数，在组件第一次渲染时才会有效
  created() {
    // console.log(this.$route);
    this.findAllUser()
  },
  watch: {
    $route(to,from){
      console.log(to);
      console.log(from);
    }
  },
};
</script>